package cn.iocoder.yudao.module.erp.dal.mysql.producthtosrelation;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.producthtosrelation.ProductHtosRelationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.producthtosrelation.vo.*;

/**
 * ERP 产品对照 Mapper
 *
 * @author songkai
 */
@Mapper
public interface ProductHtosRelationMapper extends BaseMapperX<ProductHtosRelationDO> {

    default PageResult<ProductHtosRelationDO> selectPage(ProductHtosRelationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProductHtosRelationDO>()
                .eqIfPresent(ProductHtosRelationDO::getHisProductId, reqVO.getHisProductId())
                .eqIfPresent(ProductHtosRelationDO::getSpdProductPId, reqVO.getSpdProductPId())
                .eqIfPresent(ProductHtosRelationDO::getSpdProductSId, reqVO.getSpdProductSId())
                .eqIfPresent(ProductHtosRelationDO::getProductNum, reqVO.getProductNum())
                .betweenIfPresent(ProductHtosRelationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ProductHtosRelationDO::getId));
    }

}